﻿package mortal.game.view.wizard
{
    import com.mui.utils.*;
    import extend.language.*;
    import mortal.component.window.*;
    import mortal.game.manager.*;
    import mortal.game.view.mount.panel.*;
    import mortal.game.view.wizard.data.*;
    import mortal.game.view.wizard.newPanel.*;
    import mortal.game.view.wizard.panel.*;
    import mortal.mvc.interfaces.*;

    public class WizardNewModule extends SpecialWindow
    {
        private var _currentPanel:WizardBasePanel;
        private var _currentWizardData:WizardData;

        public function WizardNewModule(param1:ILayer = null)
        {
            super(param1);
            this.init();
            return;
        }// end function

        override public function hide() : void
        {
            if (EquipBaseWin.isViewShow)
            {
                EquipBaseWin.instance.hide();
            }
            super.hide();
            return;
        }// end function

        private function init() : void
        {
            setSize(880, 595);
            this.title = Language.getString(35627);
            this.layer = LayerManager.windowLayer3D;
            this.winTitleName = "wizardModule";
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            this.winTitleName = "wizardModule";
            super.createDisposedChildrenImpl();
            this.changeTabBar(0);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            if (this._currentPanel)
            {
                this._currentPanel.dispose(param1);
                this._currentPanel = null;
            }
            super.disposeImpl(param1);
            return;
        }// end function

        private function addWizardInfoPanel() : WizardNewInfoPanel
        {
            var _loc_1:* = UICompomentPool.getUICompoment(WizardNewInfoPanel, this);
            this.addChild(_loc_1);
            return _loc_1;
        }// end function

        public function changeTabBar(param1:int) : void
        {
            var _loc_2:WizardBasePanel = null;
            if (this._currentPanel)
            {
                this._currentPanel.dispose(true);
            }
            switch(param1)
            {
                case 0:
                {
                    _loc_2 = this.addWizardInfoPanel();
                    break;
                }
                case 1:
                {
                    break;
                }
                default:
                {
                    break;
                }
            }
            this._currentPanel = _loc_2;
            return;
        }// end function

        public function refreshSprite() : void
        {
            if (this._currentPanel is WizardNewInfoPanel)
            {
                (this._currentPanel as WizardNewInfoPanel).refreshSprite();
            }
            return;
        }// end function

        public function updateAttrData() : void
        {
            if (this._currentPanel is WizardNewInfoPanel)
            {
                (this._currentPanel as WizardNewInfoPanel).updateAttrData();
            }
            return;
        }// end function

        public function updateItemHandler() : void
        {
            if (this._currentPanel is WizardNewInfoPanel)
            {
                (this._currentPanel as WizardNewInfoPanel).updateItemHandler();
            }
            return;
        }// end function

        public function updateMoney() : void
        {
            if (this._currentPanel is WizardNewInfoPanel)
            {
                (this._currentPanel as WizardNewInfoPanel).updateMoney();
            }
            return;
        }// end function

        public function showSelectWizard(param1:int) : void
        {
            if (this._currentPanel is WizardNewInfoPanel)
            {
                (this._currentPanel as WizardNewInfoPanel).showSelectWizard(param1);
            }
            return;
        }// end function

        public function playEffect(param1:int) : void
        {
            if (this._currentPanel is WizardNewInfoPanel)
            {
                (this._currentPanel as WizardNewInfoPanel).playEffect(param1);
            }
            return;
        }// end function

        public function updateEquip() : void
        {
            if (this._currentPanel is WizardNewInfoPanel)
            {
                (this._currentPanel as WizardNewInfoPanel).updateEquipList();
                (this._currentPanel as WizardNewInfoPanel).updateAttrData();
            }
            return;
        }// end function

        public function updateSkill() : void
        {
            if (this._currentPanel is WizardNewInfoPanel)
            {
                (this._currentPanel as WizardNewInfoPanel).updateSkill();
            }
            return;
        }// end function

        public function updateCombat() : void
        {
            if (this._currentPanel is WizardNewInfoPanel)
            {
                (this._currentPanel as WizardNewInfoPanel).updateCombat();
            }
            return;
        }// end function

        public function showFilter(param1:int) : void
        {
            if (this._currentPanel is WizardNewInfoPanel)
            {
                (this._currentPanel as WizardNewInfoPanel).showFilter(param1);
            }
            return;
        }// end function

    }
}
